package com.zisu.secs.secs.example.example3;

import com.zisu.secs.secs.secs2.Secs2;
import com.zisu.secs.secs.secs2.Secs2Exception;

/**
 * @Desc: ""
 * @Author: caixiang
 * @DATE: 2020/10/15 9:39
 */
public class Test {
    public static void main(String[] args) throws Secs2Exception {
        {
            /*
             * build-pattern-1
             * <L
             *   <B 0x0>
             *   <I4 1001>
             *   <A "MESSAGE">
             * >
             */
            Secs2 ss = Secs2.list(
                      Secs2.int4(1001)
                    , Secs2.binary((byte)0x0)
                    , Secs2.ascii("MESSAGE")
                    , Secs2.list(
                            Secs2.binary((byte)11)
                    )
            );

            System.out.println("build <L ...>");

            System.out.println(ss);

//            byte aByte = ss.getByte(1, 0);
//            System.out.println("aByte"+aByte);

            byte aaByte = ss.getByte(3, 0, 0);
            System.out.println("aaByte"+aaByte);

            System.out.println();
        }
    }
}
